<html>
<head><meta charset="utf-8"><title>Idea: inline(same_link_section) · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Idea.3A.20inline(same_link_section).html">Idea: inline(same_link_section)</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="234393667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Idea%3A%20inline%28same_link_section%29/near/234393667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Idea.3A.20inline(same_link_section).html#234393667">(Apr 13 2021 at 20:18)</a>:</h4>
<p>It occurred to me today that you might want to have a function that is in a given link_secrion and then have it be marked for inline <em>only if</em> it would inline into another function within the same link section.</p>
<p>Does this sound like a reasonable sort of thing?</p>



<a name="234409782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Idea%3A%20inline%28same_link_section%29/near/234409782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Idea.3A.20inline(same_link_section).html#234409782">(Apr 13 2021 at 22:07)</a>:</h4>
<p>I don't think there is a way to express this in LLVM IR...</p>



<a name="234415687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Idea%3A%20inline%28same_link_section%29/near/234415687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Idea.3A.20inline(same_link_section).html#234415687">(Apr 13 2021 at 23:08)</a>:</h4>
<p>It is also outside of the realm of the compiler and is more of a linker (LTO?) thing.</p>



<a name="234429991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Idea%3A%20inline%28same_link_section%29/near/234429991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Idea.3A.20inline(same_link_section).html#234429991">(Apr 14 2021 at 02:01)</a>:</h4>
<p>My idea is that this would be rustc-side: if the caller is in another link section then rustc would omit the inline attribute in the llvm ir</p>



<a name="234430053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Idea%3A%20inline%28same_link_section%29/near/234430053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Idea.3A.20inline(same_link_section).html#234430053">(Apr 14 2021 at 02:02)</a>:</h4>
<p>oh wait, inline is on functions not calls</p>



<a name="234430077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Idea%3A%20inline%28same_link_section%29/near/234430077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Idea.3A.20inline(same_link_section).html#234430077">(Apr 14 2021 at 02:02)</a>:</h4>
<p>oh well</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>